﻿using SqlSugar;
using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using GKQC.DbHelper.ViewModels;
using System.Windows.Forms.VisualStyles;

namespace GKQC.DbHelper.DbModels
{
	//研发检测单单头
	[SugarTable("t_rnd_head")]
	public class RndHeadModel
	{
		public RndHeadModel()
        {
			this.Dtls = new List<RndDtlModel>();
			this.TestDate = DateTime.Now;
			this.LcTime = 2;
			this.Standard = new StandardView();
			this.WorkTemp = "-℃ ~ +℃";
			this.Pn = string.Empty;
			this.Customer = string.Empty;
			this.CustomerPn = string.Empty; 
			this.LotNo = string.Empty;
			this.MakeType = string.Empty;
			this.PasteMaker = string.Empty;
			this.RubberMaker = string.Empty;
			this.SourceCode = string.Empty;
			this.SourceNo = string.Empty;
			this.SourceSNo = 1;
			this.Remark = string.Empty;
			this.FoilNMaker = string.Empty;
			this.FoilPMaker = string.Empty;
			this.EpsMaker = string.Empty;
			this.LType = "L";
			this.TubeDateCode = string.Empty;
			this.Series = string.Empty;
		}
		/// <summary>
		/// 流水号
		/// </summary>	
		[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
		public long Id { get; set; }

        /// <summary>
        /// 報表ID
        /// </summary>
        public int ReportId { get; set; }
		/// <summary>
		/// 電氣檢測數量
		/// </summary>
		public int ElectricQty { get; set; }
		/// <summary>
		/// 尺寸檢測數量
		/// </summary>
		public int SizeQty { get; set; }
		/// <summary>
		/// 来源单别
		/// </summary>		
		public string SourceCode { get; set; }
		/// <summary>
		/// 来源单号
		/// </summary>		
		public string SourceNo { get; set; }
		/// <summary>
		/// 来源单项次
		/// </summary>		
		public int SourceSNo { get; set; }
		/// <summary>
		/// 批号
		/// </summary>		
		public string LotNo { get; set; }
		/// <summary>
		/// 料号
		/// </summary>		
		public string Pn { get; set; }
		/// <summary>
		/// 客户
		/// </summary>		
		public string Customer { get; set; }
		/// <summary>
		/// 客户料号
		/// </summary>		
		public string CustomerPn { get; set; }
		/// <summary>
		/// 系列
		/// </summary>		
		public string Series { get; set; }
		/// <summary>
		/// 容量
		/// </summary>		
		public double Cap { get; set; }
		/// <summary>
		/// 电压
		/// </summary>		
		public double Voltage { get; set; }
		/// <summary>
		/// 本体直径
		/// </summary>		
		public double D { get; set; }
		/// <summary>
		/// 本体高度
		/// </summary>		
		public double L { get; set; }
		/// <summary>
		/// 脚距
		/// </summary>		
		public double P { get; set; }
		/// <summary>
		/// 引脚直径
		/// </summary>		
		public double cp { get; set; }
		/// <summary>
		/// H
		/// </summary>		
		public double H { get; set; }
		/// <summary>
		/// L1
		/// </summary>		
		public double L1 { get; set; }
		/// <summary>
		/// 容量下限(%)
		/// </summary>		
		public double CapMin { get; set; }
		/// <summary>
		/// 容量上限(%)
		/// </summary>		
		public double CapMax { get; set; }
		/// <summary>
		/// 高温容量变化比(%)
		/// </summary>		
		public int CapRatioHigh { get; set; }
		/// <summary>
		/// 低温容量变化比(%)
		/// </summary>		
		public int CapRatioLow { get; set; }
		/// <summary>
		/// 耐冲击容量变化率(%)
		/// </summary>		
		public int CapRatioShock { get; set; }
		/// <summary>
		/// 纹波电流(mA)
		/// </summary>		
		public double RippleCurrent { get; set; }
		/// <summary>
		/// 纹波电流電壓
		/// </summary>		
		public string RippleFreq { get; set; }
		/// <summary>
		/// 温度(℃)
		/// </summary>		
		public double Temp { get; set; }
		/// <summary>
		/// 工作温度(℃)
		/// </summary>		
		public string WorkTemp { get; set; }
		/// <summary>
		/// 濕度%RH（）
		/// </summary>		
		public double Humanity { get; set; }

		/// <summary>
		/// LC最大值(μA)
		/// </summary>		
		public double LcMax { get; set; }
		/// <summary>
		/// L类型：L或者L' 用于区分透气式和非透气式
		/// </summary>
		public string LType { get; set; }
		/// <summary>
		/// 高温LC最大值(μA)
		/// </summary>		
		public double LcMaxHigh { get; set; }
		/// <summary>
		/// 耐冲击LC最大值(μA)
		/// </summary>		
		public double LcMaxShock { get; set; }
		/// <summary>
		/// LC充电时间(分鐘)
		/// </summary>		
		public int LcTime { get; set; }
		/// <summary>
		/// ESR上限(mΩ)
		/// </summary>		
		public double EsrMax { get; set; }
		/// <summary>
		/// Z值上限(mΩ)
		/// </summary>		
		public double ZMax { get; set; }
		/// <summary>
		/// Z2值上限(mΩ)
		/// </summary>		
		public double Z2Max { get; set; }
		/// <summary>
		/// 低温阻抗比最大值
		/// </summary>		
		public double ZRatioMax { get; set; }
		/// <summary>
		/// DF最大值(%)
		/// </summary>		
		public double DfMax { get; set; }
		/// <summary>
		/// 耐冲击DF最大值(%)
		/// </summary>		
		public double DfMaxShock { get; set; }
		/// <summary>
		/// 本体高度最大值
		/// </summary>		
		public double LMax { get; set; }
		/// <summary>
		/// 本体直徑最大值
		/// </summary>		
		public double DMax { get; set; }
		/// <summary>
		/// 套管周期
		/// </summary>		
		public string TubeDateCode { get; set; }
		/// <summary>
		/// 数量
		/// </summary>		
		public int Qty { get; set; }
		/// <summary>
		/// 正箔生产商
		/// </summary>		
		public string FoilPMaker { get; set; }
		/// <summary>
		/// 负箔生产商
		/// </summary>		
		public string FoilNMaker { get; set; }
		/// <summary>
		/// 电解液生产商
		/// </summary>		
		public string PasteMaker { get; set; }
		/// <summary>
		/// 电解纸生产商
		/// </summary>		
		public string EpsMaker { get; set; }
		/// <summary>
		/// 胶盖/盖板生产商
		/// </summary>		
		public string RubberMaker { get; set; }
		/// <summary>
		/// 加工方式
		/// </summary>		
		public string MakeType { get; set; }
		/// <summary>
		/// 建立日期
		/// </summary>		
		public DateTime CreateDate { get; set; }
		/// <summary>
		/// 单据日期
		/// </summary>		
		public DateTime TestDate { get; set; }
		/// <summary>
		/// 更新日期
		/// </summary>		
		public DateTime? ModiDate { get; set; }
		/// <summary>
		/// 建立人
		/// </summary>		
		public string CreateUser { get; set; }
		/// <summary>
		/// 修改人
		/// </summary>		
		public string ModiUser { get; set; }
		/// <summary>
		/// 备注
		/// </summary>		
		public string Remark { get; set; }

		/// <summary>
		/// 審核日期
		/// </summary>
		public DateTime? ApproveDate { get; set; }
		/// <summary>
		/// 審核人
		/// </summary>
		public string ApproveUser { get; set; }
		/// <summary>
		/// 浪湧電壓（SurgeVolt）
		/// </summary>
		public double SurgeVolt { get; set; }

		[SugarColumn(IsIgnore = true)]
		public List<RndDtlModel> Dtls { get; set; }

		[SugarColumn(IsIgnore = true)]
		public StandardView Standard { get; set; }

		/// <summary>
		/// 返回尺寸格式為：D*L
		/// </summary>
		/// <returns></returns>
		public string GetSizeString()
        {
			return this.D.ToString() + "*" + this.L.ToString();
        }

		/// <summary>
		/// 返回规格格式為：320μF/16V
		/// </summary>
		/// <returns></returns>
		public string GetSpecString()
		{
			return this.Cap.ToString() + "μF/" + this.Voltage.ToString() + "V";
		}
	}
}

